package com.lingnan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lingnan.entity.po.Interview;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface InterviewMapper extends BaseMapper<Interview> {
    
    /**
     * 根据求职者姓名更新面试记录中的求职者信息
     */
    @Update("UPDATE interview SET seeker_name = #{newName} " +
            "WHERE seeker_name = #{oldName}")
    int updateSeekerNameBatch(@Param("oldName") String oldName,
                             @Param("newName") String newName);
    
    /**
     * 根据投递ID查询面试记录
     */
    @Select("SELECT * FROM interview WHERE application_id = #{applicationId}")
    List<Interview> selectByApplicationId(@Param("applicationId") Long applicationId);
}